package creature;

import toxi.math.MathUtils;



/**
 * simple sin osc with amp and speed
 * TODO: check proper implementation!
 * @author ronin
 *
 */
public class Oscillator
{
	public float	amplitude	= 1.0f;
	public float	angle			= 0.0f;
	public float 	speed			= 0.001f;
	public float 	value			= 0.0f;
	
	public Oscillator(float _amplitude, float _speed)
	{
		amplitude = _amplitude;
		speed = _speed;
	}
	
	public void update()
	{
		value = amplitude * (float) Math.sin(angle);
		
		angle += speed;
		angle %= MathUtils.TWO_PI;
	}
}
